package com.yihuan.service;

import com.yihuan.entity.ShoppingEntity;
import com.yihuan.mapper.ShoppingMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author:梦醒
 * Date: 2022/4/24 16:06
 * Dream:
 * 信言不美，美言不信。
 * 善者不辩，辩者不善。
 * 知者不博，博者不知。
 * Function:
 */
@Service
public class ShoppingService {
    @Resource
    ShoppingMapper shoppingMapper;
    
    /**
     * 注册购物车信息
     *
     * @param shoppingEntity
     * @return
     */
    
    public int insertShoppingByShoppingData(ShoppingEntity shoppingEntity) {
        return shoppingMapper.insertShoppingByShoppingData(shoppingEntity);
    }
    
    
    /**
     * 更改购物车信息删除状态
     *
     * @param shoppingEntity
     * @return
     */
    public int updateShoppingByShoppingDeleteState(ShoppingEntity shoppingEntity) {
        return shoppingMapper.updateShoppingByShoppingDeleteState(shoppingEntity);
    }
    
    /**
     * 购物车分页查询数据
     *
     * @param shoppingEntity
     * @return
     */
    public List<ShoppingEntity> findShoppingByShoppingList(ShoppingEntity shoppingEntity) {
        return shoppingMapper.findShoppingByShoppingList(shoppingEntity);
    }
    
    /**
     * 购物车统计分页查询数据
     *
     * @param shoppingEntity
     * @return
     */
    public int countShoppingList(ShoppingEntity shoppingEntity) {
        return shoppingMapper.countShoppingList(shoppingEntity);
    }
    
    /**
     * 购物车公司分页查询数据
     *
     * @param shoppingEntity
     * @return
     */
    public List<ShoppingEntity> findShoppingByShoppingCompanyList(ShoppingEntity shoppingEntity) {
        return shoppingMapper.findShoppingByShoppingCompanyList(shoppingEntity);
    }
    
    /**
     * 查询数据 按编号
     *
     * @param shoppingEntity
     * @return
     */
    
    public List<ShoppingEntity> findShoppingByShoppingID(ShoppingEntity shoppingEntity) {
        return shoppingMapper.findShoppingByShoppingID(shoppingEntity);
    }
}
